#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=100, maxm=100;

long long max(long long a, long long b) {
  return a>b ? a : b;
}

int main() {
  freopen("maja.in", "r", stdin);
  freopen("maja.out", "w", stdout);

  static int c[maxn+1][maxm+1];
  int n, m, a, b, k;
  scanf("%d %d %d %d %d", &n, &m, &a, &b, &k);
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=m; j++) {
      scanf("%d", &c[i][j]);
    }
  }

  const int fx[4][2]= {{-1, 0}, {0, -1}, {0, 1}, {1, 0}};
  static long long f[maxn+1][maxm+1][2];
  f[a][b][0] = c[a][b];
  for (int t=1; t<=k; t++) {
    for (int i=1; i<=n; i++) {
      for (int j=1; j<=m; j++) {
	for (int x=0; x<4; x++) {
	  int nx=i+fx[x][0], ny=j+fx[x][1];
	  if (nx>0 && ny>0 && nx<=n && ny<=m) {
	    f[i][j][t%2] = max(f[i][j][t%2], f[nx][ny][(t-1)%2]+c[i][j]);
	  }
	}
      }
    }
  }

  printf("%lld", f[a][b][k%2]);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
